/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ec.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.ec.dao.ItemCategoryDao;
import com.thinkgem.jeesite.modules.ec.entity.ItemCategory;

/**
 * 商品分类Service
 * @author zkool
 * @version 2016-01-16
 */
@Service
@Transactional(readOnly = true)
public class ItemCategoryService extends TreeService<ItemCategoryDao, ItemCategory> {

	public ItemCategory get(String id) {
		return super.get(id);
	}
	
	public List<ItemCategory> findList(ItemCategory itemCategory) {
		if (StringUtils.isNotBlank(itemCategory.getParentIds())){
			itemCategory.setParentIds(","+itemCategory.getParentIds()+",");
		}
		return super.findList(itemCategory);
	}
	
	@Transactional(readOnly = false)
	public void save(ItemCategory itemCategory) {
		super.save(itemCategory);
	}
	
	@Transactional(readOnly = false)
	public void delete(ItemCategory itemCategory) {
		super.delete(itemCategory);
	}
	
}